﻿<%@ Page Title="Value-added Products" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="VA_Products.aspx.cs" Inherits="IFD2.VA_Products" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <form id="form1" runat="server" role="form" class="form-inline" defaultbutton="lbtnQuery">
    <%--<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>--%>
    <div class="container-fluid body-content" style="width:100%;">

    <div class="row">
        <div class="col-sm-2 well well-sm">
            <h5><asp:Literal ID="litTitle" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h5>
            <div class="form-group">
                <asp:Label ID="Label3" runat="server" Text="Status:" meta:resourcekey="Status"></asp:Label>
                <asp:DropDownList ID="lstStatus" runat="server" CssClass="form-control input-sm" Width="100%">
                    <asp:ListItem Value="E" meta:resourcekey="Editing">Editing</asp:ListItem>
                    <asp:ListItem Value="S" meta:resourcekey="Submitted">Submitted</asp:ListItem>
                    <asp:ListItem Value="A" meta:resourcekey="Approved" Selected="True">Approved</asp:ListItem>
                    <asp:ListItem Value="C" meta:resourcekey="Closed">Closed</asp:ListItem>
                </asp:DropDownList>
            </div>
            <br class="hidden-xs"/><br class="hidden-xs"/>
            <asp:LinkButton ID="lbtnQuery" runat="server" CssClass="form-control input-sm btn-primary text-center" Width="100%" ToolTip="" meta:resourcekey="tipQuery" OnClick="lbtnQuery_Click"> <span class="glyphicon glyphicon-search" style="font-size:large;"></span></asp:LinkButton>
            <p></p><%--没有此行(或&nbsp;)，上面的按钮在手机模式(xs)下，只有上半部可以点击！--%>
        </div>

        <div class="col-sm-10 well well-sm">
            <div class="panel">
                <div class="panel-heading btn-primary">
                    <h6 class="panel-title" id="section-2"><asp:Literal ID="Literal1" runat="server" meta:resourcekey="tipPageTitle"></asp:Literal></h6>
                </div>
                <div class="panel-body">
                    <div class="table-responsive">
                        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" style="min-width:700px;width:100%;" class="table-hover"
                            DataKeyNames="airline,id" DataSourceID="sqlFares" ForeColor="#333333" GridLines="None">
                            <RowStyle BackColor="#EFF3FB" />
                            <Columns>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                    <input name="KEY" type="radio" value='<%# Eval("airline")+"|"+Eval("id") %>' />
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <asp:BoundField DataField="id" HeaderText="id" ReadOnly="True" SortExpression="id"  meta:resourcekey="id1" />
                                <asp:BoundField DataField="emd_type" HeaderText="emd_type" SortExpression="emd_type"  meta:resourcekey="emd_type" />
                                <asp:TemplateField HeaderText="price" SortExpression="price" meta:resourcekey="Price1">
                                    <ItemTemplate>
                                    <%# Eval("currency") +""+ Eval("price","{0:N}") %>
                                    </ItemTemplate>
                                </asp:TemplateField>
                                <%--asp:BoundField DataField="service_place" HeaderText="service_place" SortExpression="service_place"  meta:resourcekey="service_place" />
                                <asp:BoundField DataField="flt_date_from" HeaderText="flt_date_from" SortExpression="flt_date_from"  meta:resourcekey="flt_date_from" />
                                <asp:BoundField DataField="flt_date_to" HeaderText="flt_date_to" SortExpression="flt_date_to"  meta:resourcekey="flt_date_to" /--%>
                                <asp:BoundField DataField="close_before_flt" HeaderText="close_before_flt" SortExpression="close_before_flt"  meta:resourcekey="close_before_flt1" />
                                <asp:BoundField DataField="done_user" HeaderText="done_user" SortExpression="done_user"  meta:resourcekey="done_user" />
                                <asp:BoundField DataField="done_time" HeaderText="done_time" SortExpression="done_time"  meta:resourcekey="done_time" />
                            </Columns>
                            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                            <EditRowStyle BackColor="#2461BF" />
                            <AlternatingRowStyle BackColor="White" />
                        </asp:GridView>
                    </div>
                    <div class="btn-group">
                    <asp:Button ID="btnDetails" runat="server" onclick="btnDetails_Click"  CssClass="btn btn-sm btn-default" Text="Detailes..." meta:resourcekey="Detailes"/>
                    <asp:Button ID="btnSubmit" runat="server" Text="Submit" OnClick="btnSubmit_Click" CssClass="btn btn-sm btn-default"  meta:resourcekey="Submit" />
                    <asp:Button ID="btnDelete" runat="server" Text="Delete" OnClick="btnDelete_Click" CssClass="btn btn-sm btn-default"  meta:resourcekey="Delete" />
                    <asp:Button ID="btnApprove" runat="server" Text="Approve" OnClick="btnApprove_Click" CssClass="btn btn-sm btn-default"  meta:resourcekey="Approve" />
                    <asp:Button ID="btnReject" runat="server" Text="Reject" OnClick="btnReject_Click" CssClass="btn btn-sm btn-default"  meta:resourcekey="Reject" />
                    <asp:Button ID="btnClose" runat="server" Text="Close" OnClick="btnClose_Click" CssClass="btn btn-sm btn-default"  meta:resourcekey="Close" />
                    <asp:Button ID="btnLog" runat="server" OnClick="btnLog_Click" Text="Log..." CssClass="btn btn-sm btn-default"  meta:resourcekey="Log" />
                    </div><br />
                    <asp:Label ID="lblError" runat="server" CssClass="ifdMessage"></asp:Label>


                    <asp:SqlDataSource ID="sqlFares" runat="server" ConnectionString="<%$ ConnectionStrings:IFD_DB %>" DataSourceMode="DataReader" 
                        SelectCommand="bll_emd_get_by_status" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                            <asp:SessionParameter Name="airline" SessionField="AIRLINE" Type="String" />
                            <asp:ControlParameter ControlID="lstStatus" Name="status" PropertyName="SelectedValue" Type="String" />
                        </SelectParameters>
                    </asp:SqlDataSource>
                    <asp:SqlDataSource ID="sqlCurrencies" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:IFD_DB %>" DataSourceMode="DataReader" 
                        SelectCommand="bll_currency_get_codes" SelectCommandType="StoredProcedure">
                    </asp:SqlDataSource>

                   <%-- <asp:UpdatePanel ID="panNew" runat="server"><ContentTemplate>--%>
                    <div class="well well-sm">
                         <asp:Label ID="Label1" runat="server" Font-Bold="True" meta:resourcekey="NewCommodity" Text="New Commodity"></asp:Label>
                        <br />
                        <div class="form-group">
                        <asp:Label ID="Label2" runat="server" meta:resourcekey="ID" Text="ID:"></asp:Label>
                        <asp:TextBox ID="txtID" runat="server" MaxLength="13" Width="136px"></asp:TextBox>
                        <asp:Label ID="Label18" runat="server" Font-Italic="True" Text="[D|A][Category][ID]" meta:resourcekey="ID_note"></asp:Label>
                        </div>
                        <br class="hidden-xs"/>
                        <div class="form-group">
                        <asp:Label ID="Label8" runat="server" meta:resourcekey="Type" Text="Type:"></asp:Label>
                        <asp:DropDownList ID="lstTypes" runat="server" AutoPostBack="True" onselectedindexchanged="lstTypes_SelectedIndexChanged">
                            <asp:ListItem meta:resourcekey="Associated" Value="A" Selected="True">A - Associated</asp:ListItem>
                            <asp:ListItem meta:resourcekey="StandAlone" Value="S" Enabled="false">S - Stand-alone</asp:ListItem>
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label6" runat="server" meta:resourcekey="Currency" Text="Currency:"></asp:Label>
                        <asp:DropDownList ID="lstCurrencies" runat="server" DataSourceID="sqlCurrencies" DataTextField="code" DataValueField="code">
                        </asp:DropDownList>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label7" runat="server" meta:resourcekey="Price" Text="Price:"></asp:Label>
                        <asp:TextBox ID="txtPrice" runat="server" Width="70px" MaxLength="10"></asp:TextBox>
                        </div>
                        <div class="form-group">
                        <asp:Label ID="Label16" runat="server" Text="Closed before flt.: " meta:resourcekey="ClosedBeforeFlt"></asp:Label>
                        <asp:TextBox ID="txtCloseBefore" runat="server" Width="50px" MaxLength="5">0.0</asp:TextBox>
                        <asp:Label ID="Label17" runat="server" Text="(Hours)"  meta:resourcekey="Hours"></asp:Label>
                        </div>
                        <br class="hidden-xs"/>
                        <asp:Button ID="btnAdd" runat="server" meta:resourcekey="Add" OnClick="btnAdd_Click" Text=" Add " CssClass="btn btn-sm btn-default" />
                        <br />
                        <asp:Label ID="lblErrNew" runat="server" CssClass="ifdMessage"></asp:Label>
                    </div>
                    <%--</ContentTemplate></asp:UpdatePanel>--%>
                </div>
            </div>
        </div>
    </div>

    </div></form>

    <script src="JS/ScrollableGridPlugin.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var win_height = parseInt($(window).height());
            var tab_new_height= win_height-50-100;//菜单占50， 为便于操作留空100
            if ($('#<%=GridView1.ClientID %>').height()>tab_new_height)
                $('#<%=GridView1.ClientID %>').Scrollable({ ScrollHeight: tab_new_height });
        });
    </script>

</asp:Content>
